autonomous-sdlc-harness 0.2.0 → 0.4.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/README.md +2 -2
- package/dist/cli.js +0 -0
- package/dist/commands/docs.js +2 -1
- package/dist/commands/docs.js.map +1 -1
- package/dist/commands/doctor.js +27 -6
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/init.js +102 -20
- package/dist/commands/init.js.map +1 -1
- package/dist/config/check.js +11 -4
- package/dist/config/check.js.map +1 -1
- package/dist/config/model.js +25 -0
- package/dist/config/model.js.map +1 -1
- package/dist/core/git.js +29 -0
- package/dist/core/git.js.map +1 -1
- package/dist/core/paths.js +22 -2
- package/dist/core/paths.js.map +1 -1
- package/dist/core/prompt.js +6 -2
- package/dist/core/prompt.js.map +1 -1
- package/dist/core/writer.js +2 -0
- package/dist/core/writer.js.map +1 -1
- package/dist/doctor/checks.js +343 -28
- package/dist/doctor/checks.js.map +1 -1
- package/dist/generators/githubWorkflows.js +66 -0
- package/dist/generators/githubWorkflows.js.map +1 -0
- package/dist/generators/notifications.js +105 -19
- package/dist/generators/notifications.js.map +1 -1
- package/dist/generators/outerLoopScripts.js +17 -3
- package/dist/generators/outerLoopScripts.js.map +1 -1
- package/dist/generators/permissionProfile.js +101 -12
- package/dist/generators/permissionProfile.js.map +1 -1
- package/dist/generators/repoRoot.js +18 -2
- package/dist/generators/repoRoot.js.map +1 -1
- package/dist/generators/stateDir.js +9 -3
- package/dist/generators/stateDir.js.map +1 -1
- package/dist/machine/paths.js +4 -1
- package/dist/machine/paths.js.map +1 -1
- package/dist/remote/githubActions.js +86 -0
- package/dist/remote/githubActions.js.map +1 -0
- package/dist/retrieval/queryLog.js +6 -4
- package/dist/retrieval/queryLog.js.map +1 -1
- package/dist/retrieval/runtime.js +12 -22
- package/dist/retrieval/runtime.js.map +1 -1
- package/dist/retrieval/search.js +21 -10
- package/dist/retrieval/search.js.map +1 -1
- package/dist/retrieval/server.js +1 -1
- package/dist/retrieval/setup.js +2 -1
- package/dist/retrieval/setup.js.map +1 -1
- package/package.json +1 -1
- package/templates/README.md +3 -2
- package/templates/claude/context/conventions.md +1 -1
- package/templates/claude/context/layer.md +1 -1
- package/templates/claude/push-notify.env.example +7 -2
- package/templates/claude/settings.autonomous.json +1 -1
- package/templates/github/workflows/harness-resume.yml +124 -0
- package/templates/github/workflows/harness-run.yml +446 -0
- package/templates/repo/gitignore +5 -0
- package/templates/scripts/README.md +1 -1
- package/templates/scripts/autonomous-watcher.sh +1141 -143
- package/templates/scripts/flow-walker.sh +629 -0
- package/templates/scripts/flows/task_plan_writing.graph.json +192 -0
- package/templates/scripts/lib/flow-walker-gates.sh +165 -0
- package/templates/scripts/lib/harness-run-lib.sh +433 -18
- package/templates/scripts/remote-run.sh +1785 -0
- package/templates/scripts/restart-watcher.sh +21 -1
- package/templates/scripts/run-test-suite.sh +182 -0
- package/templates/scripts/scratch-run.sh +2 -1
- package/templates/state-dir/README-root.md +1 -1
- package/templates/state-dir/autonomous_logs/README.md +1 -1
- package/templates/state-dir/improvement_observations/README.md +2 -0
- package/templates/state-dir/scratch/README.md +1 -1
- package/templates/state-dir/test_fix_plan_reviews/README.md +9 -0
- package/templates/state-dir/test_fix_plans/README.md +9 -0
- package/templates/state-dir/test_fix_point_reviews/README.md +9 -0
- package/templates/state-dir/test_run_logs/README.md +11 -0
package/dist/core/writer.js
CHANGED
|
@@ -46,6 +46,8 @@
|
|
|
46
46
|
* | `.gitignore` | `merge-lines` (a managed block, lines not already present) | Every repo already has one. |
|
|
47
47
|
* | The `stateDir` tree and its per-directory READMEs | `ensure-dir` + `create-if-absent` | Creating what is missing is the whole operation; an adopter may have rewritten a contract sentence. |
|
|
48
48
|
* | The ledgers `lessons.md` / `improvement_suggestions.md` | `create-if-absent`, **not upgraded by `--force`** | Ledgers accumulate and nothing can re-derive one; the engine's `.bak` is single-generation, so `--force` may not touch them. |
|
|
49
|
+
* | `.github/workflows/harness-run.yml` | `create-if-absent` | Written only when `execution.target` is `github-actions`; the adopter tunes the timeouts and the runner, and `--force` after a `.bak` is the upgrade path, which also re-pins the CLI version rendered into it. |
|
|
50
|
+
* | `.github/workflows/harness-resume.yml` | `create-if-absent` | Written only when `execution.target` is `github-actions`; the adopter tunes the cron, and `--force` after a `.bak` is the upgrade path. |
|
|
49
51
|
* | Git hook `pre-push`, wrapper scripts | `create-if-absent` | Adopter may have edited the guard. The hook alone is also replaced, after a `.bak`, by the one run that rebuilt the config it is rendered from (`init --reset-config`) — and only where its rendered `case` label no longer matches the set that config resolves, never where the label cannot be read. |
|
|
50
52
|
*
|
|
51
53
|
* `--force` upgrades **`create-if-absent` only** to overwrite-after-backup, and only where the
|
package/dist/core/writer.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"writer.js","sourceRoot":"","sources":["../../src/core/writer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuFG;AAEH,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7G,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzE,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,YAAY,EAAmB,MAAM,WAAW,CAAC;AACpF,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAqIxC,uDAAuD;AACvD,MAAM,aAAa,GAA8C;IAC/D,OAAO,EAAE,SAAS;IAClB,MAAM,EAAE,QAAQ;IAChB,I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AC,CAAC,CAAC,IAAI,CAAC;AAC7E,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,aAAa,CAAC,SAAiB;IAC7C,MAAM,KAAK,GAAG,IAAI,CAAC,SAAS,EAAE,eAAe,OAAO,CAAC,GAAG,MAAM,CAAC,CAAC;IAChE,IAAI,CAAC;QACH,aAAa,CAAC,KAAK,EAAE,EAAE,EAAE,MAAM,CAAC,CAAC;IACnC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,MAAM,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACtE,OAAO,iBAAiB,MAAM,EAAE,CAAC;IACnC,CAAC;IACD,IAAI,CAAC;QACH,MAAM,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;IACjC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,MAAM,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACtE,OAAO,+CAA+C,KAAK,MAAM,MAAM,EAAE,CAAC;IAC5E,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
package/dist/doctor/checks.js
CHANGED
|
@@ -21,7 +21,11 @@
|
|
|
21
21
|
* that module's {@link GITIGNORE_BLOCK_HEADER}, the line the write engine itself matches on, the
|
|
22
22
|
* push-settings precedence is `generators/notifications.ts`'s {@link pushEnvCandidates}, the
|
|
23
23
|
* repository registry's location, reader and staleness grading are `machine/registry.ts`'s {@link registryPath},
|
|
24
|
-
* {@link readRegistry} and {@link inspect} — the same three `daemon list` enumerates through —
|
|
24
|
+
* {@link readRegistry} and {@link inspect} — the same three `daemon list` enumerates through — the
|
|
25
|
+
* remote-execution switch is `config/model.ts`'s {@link remoteExecutionApplies}, the workflow
|
|
26
|
+
* paths and the binary run as `gh` are `remote/githubActions.ts`'s ({@link WORKFLOW_RUN_PATH},
|
|
27
|
+
* {@link WORKFLOW_RESUME_PATH}, {@link GH_CLI_VARIABLE}, {@link ghCli}), whether a ref carries a
|
|
28
|
+
* file is `core/git.ts`'s {@link pathAtRef}, and
|
|
25
29
|
* the writability probe is the write engine's {@link probeWritable}. A
|
|
26
30
|
* check that wanted a slightly different answer would be a second definition of the thing being
|
|
27
31
|
* checked, which is how a green `doctor` starts disagreeing with the run it is supposed to
|
|
@@ -54,6 +58,11 @@
|
|
|
54
58
|
* did not ask says so, rather than leaving an adopter to read a pass as a promise the packages can
|
|
55
59
|
* be fetched.
|
|
56
60
|
*
|
|
61
|
+
* **Remote setup keeps the same line: it is graded from local evidence by default and asks GitHub
|
|
62
|
+
* only under `--check-github`.** {@link REMOTE_EXECUTION_CHECK} reads files, refs and `PATH`, and
|
|
63
|
+
* spawns no `gh` subcommand; {@link REMOTE_GITHUB_CHECK} spawns them only under
|
|
64
|
+
* {@link CheckContext.probeGithub}, and each is a read.
|
|
65
|
+
*
|
|
57
66
|
* **The three docs-retrieval checks keep that line.** `retrieval-dependencies` and
|
|
58
67
|
* `retrieval-model-cache` are file tests answered by `retrieval/runtime.ts`'s
|
|
59
68
|
* {@link retrievalRuntimeState} and `retrieval/models.ts`'s {@link modelFilesPresent}, and load
|
|
@@ -75,8 +84,8 @@ import { accessSync, constants as fsConstants, existsSync, readFileSync, statSyn
|
|
|
75
84
|
import { delimiter, join, posix, resolve as resolvePath } from 'node:path';
|
|
76
85
|
import { formatProblem } from '../config/check.js';
|
|
77
86
|
import { loadConfig } from '../config/io.js';
|
|
78
|
-
import { answersNone, browserWiringApplies, COMMAND_NONE_SENTINEL, CONFIG_FILENAME, DEFAULTS, FALLBACK_PRESET, isPlaceholder, LAYER_CATCH_ALL_PATH, retrievalApplies, STATE_DIR_DOT_PATTERN, STATE_DIR_PATTERN, } from '../config/model.js';
|
|
79
|
-
import { branchResolves, checkedOutBranch, commitsAhead, configuredRemotes, hasCommits, pathIsIgnored, remoteTrackingBranchResolves, resolveRepoRoot, worktreeList, } from '../core/git.js';
|
|
87
|
+
import { answersNone, browserWiringApplies, COMMAND_NONE_SENTINEL, CONFIG_FILENAME, DEFAULTS, FALLBACK_PRESET, isPlaceholder, LAYER_CATCH_ALL_PATH, remoteExecutionApplies, retrievalApplies, STATE_DIR_DOT_PATTERN, STATE_DIR_PATTERN, } from '../config/model.js';
|
|
88
|
+
import { branchResolves, checkedOutBranch, commitsAhead, configuredRemotes, hasCommits, pathAtRef, pathIsIgnored, remoteTrackingBranchResolves, resolveRepoRoot, worktreeList, } from '../core/git.js';
|
|
80
89
|
import { isJsonObject, readJsonFile } from '../core/json.js';
|
|
81
90
|
import { layerCoverage } from '../core/layerCoverage.js';
|
|
82
91
|
import { layerGapRemedy, recordedVerdictClause } from '../core/layerGapRemedy.js';
|
|
@@ -91,16 +100,17 @@ import { LAYERLESS_BY_DESIGN_PRESETS, SHARED_CONVENTIONS_PATH, TESTS_LAYER_NAME
|
|
|
91
100
|
import { FORCED_SIGNAL_ID } from '../detect/signals.js';
|
|
92
101
|
import { CLAUDE_MD_PATH, SETUP_PENDING_CLOSE, SETUP_PENDING_OPEN, SKELETON_GUIDANCE_MARKER, TASK_OFFER_PATH, UNFILLED_STUB_MARKER, } from '../generators/claudeContext.js';
|
|
93
102
|
import { caseLabelMatches, isGlobPattern, PRE_PUSH_HOOK, readProtectedCaseLabel, resolveGithooksDir, resolveProtectedBranches, } from '../generators/githooks.js';
|
|
94
|
-
import { PUSH_CMD_KEY, PUSH_URL_KEY, pushEnvCandidates, } from '../generators/notifications.js';
|
|
103
|
+
import { PUSH_CMD_KEY, PUSH_DESTINATION_PLACEHOLDER, PUSH_URL_KEY, pushEnvCandidates, } from '../generators/notifications.js';
|
|
95
104
|
import { DOCS_SEARCH_SERVER_SCRIPT_NAME, outerLoopScriptsDir } from '../generators/outerLoopScripts.js';
|
|
96
|
-
import { bashScriptRule, entryWord, isUnderDirectory, namesBrowserTool, normalizedRoot, pluginRootEntryTarget, PROFILE_PATH, readRule, renderProfile, TEMPLATE_PATH as PROFILE_TEMPLATE_PATH, } from '../generators/permissionProfile.js';
|
|
105
|
+
import { bashScriptRule, entryWord, isUnderDirectory, namesBrowserTool, normalizedRoot, pluginRootEntries, pluginRootEntryTarget, pluginRootHelpers, PROFILE_PATH, readRule, renderProfile, TEMPLATE_PATH as PROFILE_TEMPLATE_PATH, } from '../generators/permissionProfile.js';
|
|
97
106
|
import { ENABLED_PLUGINS_KEY, MARKETPLACE_ENTRY_SHAPE, MARKETPLACE_FLAG, MARKETPLACES_KEY, MARKETPLACE_NAME, marketplaceEntryDefect, PLUGIN_KEY, SETTINGS_PATH, SLUG_SHAPE, } from '../generators/projectSettings.js';
|
|
98
107
|
import { clarificationsIgnoreRules, contentsIgnoredDirectories, GITIGNORE_BLOCK_HEADER, GITIGNORE_PATH, MCP_PATH, } from '../generators/repoRoot.js';
|
|
99
108
|
import { configKeyPath, configuredWrapperFile, scriptInvocation, selectWrapper, wrappedKeyMismatch, wrappedKeyMismatchMessage, WRAPPER_SCRIPTS, wrapperCommandLine, } from '../generators/scripts.js';
|
|
100
109
|
import { selectedStateDirs } from '../generators/stateDir.js';
|
|
101
110
|
import { machineConfigDir } from '../machine/paths.js';
|
|
102
|
-
import { installedPluginsPath, knownMarketplacesPath,
|
|
111
|
+
import { installedPluginsPath, knownMarketplacesPath, pluginInstallRoot, pluginRuntimeRoot, pluginScriptsDir, } from '../machine/plugins.js';
|
|
103
112
|
import { inspect, readRegistry, registryPath } from '../machine/registry.js';
|
|
113
|
+
import { API_KEY_SECRET, DEFAULT_GH_CLI, GH_CLI_VARIABLE, ghCli, GIT_TOKEN_SECRET, OAUTH_TOKEN_SECRET, PUSH_URL_SECRET, REMOTE_STOP_VARIABLE, runGh, RUNNER_VARIABLE, WORKFLOW_RESUME_FILE, WORKFLOW_RESUME_PATH, WORKFLOW_RUN_FILE, WORKFLOW_RUN_PATH, } from '../remote/githubActions.js';
|
|
104
114
|
import { modelFilesPresent } from '../retrieval/models.js';
|
|
105
115
|
import { retrievalCliEntry, retrievalModelCacheDir, retrievalRuntimeDir, retrievalRuntimeState, } from '../retrieval/runtime.js';
|
|
106
116
|
/**
|
|
@@ -123,6 +133,21 @@ const WORKTREE_SCRIPT = 'create-worktree.sh';
|
|
|
123
133
|
* `bash <scriptsDir>/<file>` — so nothing here formats that shape a second time.
|
|
124
134
|
*/
|
|
125
135
|
const REFRESH_SCRIPT = 'refresh-branch.sh';
|
|
136
|
+
/**
|
|
137
|
+
* The outer-loop script the watcher dispatches a remote run through, named in {@link requiredBinaries}'
|
|
138
|
+
* and {@link REMOTE_EXECUTION_CHECK}'s sentences on {@link WORKTREE_SCRIPT}'s terms: a file in a
|
|
139
|
+
* sentence, never resolved or read here.
|
|
140
|
+
*/
|
|
141
|
+
const REMOTE_RUN_SCRIPT = 'remote-run.sh';
|
|
142
|
+
/**
|
|
143
|
+
* The `gh api` path {@link REMOTE_GITHUB_CHECK} reads the repository's artifact retention from; `gh`
|
|
144
|
+
* fills `{owner}` and `{repo}` from the checkout's remote. Local, not a `remote/githubActions.ts`
|
|
145
|
+
* export: that module owns the names `cli/src` shares with the shell and YAML mirrors, and no shell or
|
|
146
|
+
* YAML file spells this endpoint.
|
|
147
|
+
*/
|
|
148
|
+
const ARTIFACT_RETENTION_ENDPOINT = 'repos/{owner}/{repo}/actions/permissions/artifact-and-log-retention';
|
|
149
|
+
/** Below this many days of artifact retention {@link REMOTE_GITHUB_CHECK} warns; argued there. */
|
|
150
|
+
const ARTIFACT_RETENTION_WARN_DAYS = 30;
|
|
126
151
|
/** The permission lists a generated profile carries, in the order the template writes them. */
|
|
127
152
|
const PERMISSION_LISTS = Object.freeze(['allow', 'deny', 'ask']);
|
|
128
153
|
/** An unsubstituted token, which a raw template's entry may carry and a rendered profile may not. */
|
|
@@ -367,11 +392,11 @@ function serversStartedByProfile(profile) {
|
|
|
367
392
|
* has to report on rather than crash against, and the same holds for a config or a profile that does
|
|
368
393
|
* not parse. Each failure becomes a field the check that owns that subject renders.
|
|
369
394
|
*
|
|
370
|
-
* `probeRegistry`
|
|
371
|
-
* context built without
|
|
372
|
-
* unless the command was asked to.
|
|
395
|
+
* `probeRegistry` and `probeGithub` are the caller's answers rather than this function's, and both
|
|
396
|
+
* default to `false`: a context built without them is the context every default run gets, and no
|
|
397
|
+
* check here reaches a network unless the command was asked to.
|
|
373
398
|
*/
|
|
374
|
-
export function buildCheckContext(cwd, probeRegistry = false) {
|
|
399
|
+
export function buildCheckContext(cwd, probeRegistry = false, probeGithub = false) {
|
|
375
400
|
let repoRoot;
|
|
376
401
|
let repoProblem;
|
|
377
402
|
try {
|
|
@@ -381,7 +406,7 @@ export function buildCheckContext(cwd, probeRegistry = false) {
|
|
|
381
406
|
repoProblem = messageOf(error);
|
|
382
407
|
}
|
|
383
408
|
if (repoRoot === undefined)
|
|
384
|
-
return { cwd, repoProblem, configProblems: [], probeRegistry };
|
|
409
|
+
return { cwd, repoProblem, configProblems: [], probeRegistry, probeGithub };
|
|
385
410
|
const loaded = loadConfig(repoRoot);
|
|
386
411
|
const profilePath = join(repoRoot, PROFILE_PATH);
|
|
387
412
|
let profile;
|
|
@@ -411,6 +436,7 @@ export function buildCheckContext(cwd, probeRegistry = false) {
|
|
|
411
436
|
profileProblem,
|
|
412
437
|
profilePath,
|
|
413
438
|
probeRegistry,
|
|
439
|
+
probeGithub,
|
|
414
440
|
};
|
|
415
441
|
}
|
|
416
442
|
/** Is this repository inside a work tree at all — the precondition every repo-wiring check has. */
|
|
@@ -1055,7 +1081,7 @@ function deliveryOptInAdvice(candidates) {
|
|
|
1055
1081
|
const repositoryRemedy = candidates.some((candidate) => candidate.origin === 'repository')
|
|
1056
1082
|
? ', and the repository-side one is filled in by hand'
|
|
1057
1083
|
: `; this repository configures no repository-side file, so filling one means setting \`pushEnvPath\` in ${CONFIG_FILENAME} first`;
|
|
1058
|
-
return `delivery is opt-in and defaults to nothing pushed, so with neither ${PUSH_URL_KEY} nor ${PUSH_CMD_KEY} set an unattended run's completed, parked and failed events reach a macOS desktop banner where one is available and nothing at all on a Linux host. \`${CLI} init --notifications --push-url
|
|
1084
|
+
return `delivery is opt-in and defaults to nothing pushed, so with neither ${PUSH_URL_KEY} nor ${PUSH_CMD_KEY} set an unattended run's completed, parked and failed events reach a macOS desktop banner where one is available and nothing at all on a Linux host. \`${CLI} init --notifications --push-url ${PUSH_DESTINATION_PLACEHOLDER}\` writes the machine-local file for you${repositoryRemedy}`;
|
|
1059
1085
|
}
|
|
1060
1086
|
/**
|
|
1061
1087
|
* Which settings file an unattended run's notifier will actually read, and whether either delivery
|
|
@@ -1597,7 +1623,10 @@ function commandHeads(config, repoRoot) {
|
|
|
1597
1623
|
* configuration through and which {@link JQ_CHECK} already treats as a hard floor; and the agent CLI
|
|
1598
1624
|
* above, whose name arrives as the installed unit's value — `undefined` or empty when the unit does
|
|
1599
1625
|
* not set it, which is the default case because `${HARNESS_AGENT_CLI:-claude}` reads an empty value
|
|
1600
|
-
* as unset too.
|
|
1626
|
+
* as unset too. **A conditional fourth joins them only when {@link remoteExecutionApplies}:** the
|
|
1627
|
+
* binary run as `gh`, which `remote-run.sh` dispatches every remote run through. Its name is the
|
|
1628
|
+
* unit's own {@link GH_CLI_VARIABLE} value when set and non-empty, else {@link DEFAULT_GH_CLI}, on
|
|
1629
|
+
* the agent CLI's terms. With remote execution off the list is exactly the three and the derived.
|
|
1601
1630
|
*
|
|
1602
1631
|
* **The unit of comparison is the head of a command line**, over the two places such a line lives, and
|
|
1603
1632
|
* deriving it is {@link commandHeads}' — this check classifies nothing itself, so it and its sibling
|
|
@@ -1623,7 +1652,7 @@ function commandHeads(config, repoRoot) {
|
|
|
1623
1652
|
* `ENOENT` in with them printed an unfollowable instruction over the one state `init` clears by
|
|
1624
1653
|
* itself (Finding 1).
|
|
1625
1654
|
*/
|
|
1626
|
-
function requiredBinaries(config, repoRoot, unitAgentCli) {
|
|
1655
|
+
function requiredBinaries(config, repoRoot, unitAgentCli, unitGhCli) {
|
|
1627
1656
|
const found = new Map();
|
|
1628
1657
|
const ungraded = [];
|
|
1629
1658
|
// Named `absent` rather than `missing`: in this module a *missing* binary is one the unit's PATH
|
|
@@ -1644,6 +1673,10 @@ function requiredBinaries(config, repoRoot, unitAgentCli) {
|
|
|
1644
1673
|
add(agent === '' ? DEFAULT_AGENT_CLI : agent, agent === ''
|
|
1645
1674
|
? `the watcher's agent binary (${AGENT_CLI_VARIABLE} unset in the unit, so the watcher's default)`
|
|
1646
1675
|
: `the watcher's agent binary (${AGENT_CLI_VARIABLE}, as the unit sets it)`);
|
|
1676
|
+
if (remoteExecutionApplies(config)) {
|
|
1677
|
+
const gh = unitGhCli?.trim() ?? '';
|
|
1678
|
+
add(gh === '' ? DEFAULT_GH_CLI : gh, `${REMOTE_RUN_SCRIPT}, which the watcher dispatches every run through while execution.target is github-actions (${GH_CLI_VARIABLE} ${gh === '' ? 'unset in the unit, so the default' : 'as the unit sets it'})`);
|
|
1679
|
+
}
|
|
1647
1680
|
// `deploy` is this check's to skip, on both arms: its command line lives on `deploy.command`
|
|
1648
1681
|
// rather than in `commands`, and no daemon-launched run deploys. {@link commandHeads} derives it
|
|
1649
1682
|
// for its other consumer, which does grade it.
|
|
@@ -1781,7 +1814,7 @@ const DAEMON_PATH_CHECK = {
|
|
|
1781
1814
|
}
|
|
1782
1815
|
return warn(`the ${backend.kind} unit for ${unit.label} is at ${unit.targetPath} and could not be read (${messageOf(error)}), so the PATH it gives the daemon is unknown: read it yourself, or ${reinstallAdvice(backend.kind)}`);
|
|
1783
1816
|
}
|
|
1784
|
-
const { binaries: required, ungraded, absent } = requiredBinaries(ctx.config, ctx.repoRoot, unitEnvValue(backend.kind, text, AGENT_CLI_VARIABLE));
|
|
1817
|
+
const { binaries: required, ungraded, absent } = requiredBinaries(ctx.config, ctx.repoRoot, unitEnvValue(backend.kind, text, AGENT_CLI_VARIABLE), unitEnvValue(backend.kind, text, GH_CLI_VARIABLE));
|
|
1785
1818
|
const envPath = unitEnvValue(backend.kind, text, 'PATH');
|
|
1786
1819
|
if (envPath === undefined) {
|
|
1787
1820
|
return warn(`the ${backend.kind} unit for ${unit.label} at ${unit.targetPath} carries no PATH, so the daemon runs on the service manager's own default directories — the state every unit installed before this key shipped is in, and on macOS that is /usr/bin:/bin:/usr/sbin:/sbin, where a Homebrew package manager and an agent CLI under ~/.local/bin both fail to resolve. An unattended run then dies at its first configured command with \`command not found\` while a foreground run is fine, because your shell's PATH is not this. To fix it, ${reinstallAdvice(backend.kind)}`);
|
|
@@ -1793,6 +1826,285 @@ const DAEMON_PATH_CHECK = {
|
|
|
1793
1826
|
return pass(`the ${backend.kind} unit for ${unit.label} at ${unit.targetPath} carries a PATH reaching every binary an unattended run invokes by name${ungraded.length + absent.length > 0 ? ' that could be derived here' : ''}, each with what requires it: ${nameList(required.map((binary) => `${binary.name} (${binary.sources.join(', ')})`))}. This grades that file rather than this machine — the shell doctor runs in resolves what a service manager's environment does not${describeUngraded(ungraded, absent)}`);
|
|
1794
1827
|
},
|
|
1795
1828
|
};
|
|
1829
|
+
/**
|
|
1830
|
+
* The configured execution target, and whether this repository has what a remote run needs locally.
|
|
1831
|
+
*
|
|
1832
|
+
* **Remote setup is graded from local evidence by default and asks GitHub only under
|
|
1833
|
+
* `--check-github`** (the module header's choice 3). This reads the two workflow files, one git ref
|
|
1834
|
+
* and `PATH`, and spawns no `gh` subcommand: resolving the binary {@link ghCli} names is the whole of
|
|
1835
|
+
* its `gh` question. What only GitHub can answer — the secrets, the variables, whether GitHub knows
|
|
1836
|
+
* the workflow — the pass text names and leaves to that flag.
|
|
1837
|
+
*
|
|
1838
|
+
* **Every finding is reported, and the grade is the worst of them.** Two `fail`s: no
|
|
1839
|
+
* `harness-run.yml`, because no remote run can be dispatched; and no `gh`, because the watcher
|
|
1840
|
+
* dispatches through it. Three `warn`s: no `harness-resume.yml`, because a usage-paused hosted run then
|
|
1841
|
+
* waits for `/autonomous-sdlc-harness:branch-resume`; a `harness-run.yml` that
|
|
1842
|
+
* `origin/<defaultBranch>` does not carry, because GitHub dispatches only a workflow its default
|
|
1843
|
+
* branch has — the run starts once it is pushed, so nothing is broken here; and `phases.qa` true,
|
|
1844
|
+
* because a remote run skips the interactive-test phase and the branch still reaches review — the
|
|
1845
|
+
* phase is then owed a local run. It needs no GitHub answer, so it is asked here rather than in
|
|
1846
|
+
* {@link REMOTE_GITHUB_CHECK}.
|
|
1847
|
+
*
|
|
1848
|
+
* `gh` is resolved on **this shell's** `PATH`. Whether the installed daemon's `PATH` reaches it is
|
|
1849
|
+
* {@link DAEMON_PATH_CHECK}'s question, answered there through {@link requiredBinaries}' conditional
|
|
1850
|
+
* member, so it is not asked twice.
|
|
1851
|
+
*
|
|
1852
|
+
* **A missing `origin/<defaultBranch>`, or an unusable `defaultBranch`, leaves the origin row
|
|
1853
|
+
* ungraded** and the detail says so: that ref's absence is {@link REMOTE_CHECK}'s `fail`, and
|
|
1854
|
+
* reporting it again would make one finding two. It is asked only when `harness-run.yml` exists here,
|
|
1855
|
+
* for the same reason. The ref is read as this checkout last fetched it.
|
|
1856
|
+
*
|
|
1857
|
+
* With remote execution off, a workflow file left in place is a `pass` that says it does nothing:
|
|
1858
|
+
* the watcher dispatches nothing while the key is `local`.
|
|
1859
|
+
*/
|
|
1860
|
+
const REMOTE_EXECUTION_CHECK = {
|
|
1861
|
+
id: 'remote-execution',
|
|
1862
|
+
title: 'the configured execution target, and whether this repository has what a remote run needs locally',
|
|
1863
|
+
run: (ctx) => {
|
|
1864
|
+
if (ctx.repoRoot === undefined)
|
|
1865
|
+
return unevaluated('the repository root did not resolve (see the git check)');
|
|
1866
|
+
if (ctx.config === undefined)
|
|
1867
|
+
return unevaluated(`${CONFIG_FILENAME} could not be read (see the config check)`);
|
|
1868
|
+
const root = ctx.repoRoot;
|
|
1869
|
+
const present = (path) => existsSync(join(root, ...path.split('/')));
|
|
1870
|
+
const runPresent = present(WORKFLOW_RUN_PATH);
|
|
1871
|
+
const resumePresent = present(WORKFLOW_RESUME_PATH);
|
|
1872
|
+
if (!remoteExecutionApplies(ctx.config)) {
|
|
1873
|
+
const left = [WORKFLOW_RUN_PATH, WORKFLOW_RESUME_PATH].filter(present);
|
|
1874
|
+
if (left.length === 0)
|
|
1875
|
+
return pass('local execution; remote execution is off (`execution.target`)');
|
|
1876
|
+
return pass(`local execution; remote execution is off (\`execution.target\`), so ${nameList(left)} ${left.length === 1 ? 'is' : 'are'} present and unused: the watcher dispatches nothing while the key is local. \`${CLI} config set execution.target github-actions\` turns remote execution on`);
|
|
1877
|
+
}
|
|
1878
|
+
const failures = [];
|
|
1879
|
+
const warnings = [];
|
|
1880
|
+
const notes = [];
|
|
1881
|
+
if (!runPresent) {
|
|
1882
|
+
failures.push(`${WORKFLOW_RUN_PATH} is absent, so no remote run can be dispatched: re-run \`${CLI} init\`, which writes it create-if-absent while execution.target is github-actions`);
|
|
1883
|
+
}
|
|
1884
|
+
if (!resumePresent) {
|
|
1885
|
+
warnings.push(`${WORKFLOW_RESUME_PATH} is absent, so a hosted run paused on usage waits for /autonomous-sdlc-harness:branch-resume instead of resuming on its own: re-run \`${CLI} init\` to write it`);
|
|
1886
|
+
}
|
|
1887
|
+
const gh = ghCli();
|
|
1888
|
+
if (!resolvesOnPath(gh)) {
|
|
1889
|
+
failures.push(`${gh} does not resolve on this shell's PATH, and the watcher dispatches every remote run through it (${REMOTE_RUN_SCRIPT}): install the GitHub CLI (https://cli.github.com) and run \`gh auth login\`, or point ${GH_CLI_VARIABLE} at it`);
|
|
1890
|
+
}
|
|
1891
|
+
if (ctx.config.phases?.qa === true) {
|
|
1892
|
+
warnings.push("phases.qa is true, but a remote run skips the interactive-test phase — GitHub Actions jobs have no browser wiring, application dependencies or QA credentials for it (docs/remote-execution.md → §3, The interactive-test phase): run /autonomous-sdlc-harness:branch-qa-test <branch> locally before merging a remote run's branch");
|
|
1893
|
+
}
|
|
1894
|
+
if (runPresent) {
|
|
1895
|
+
const branch = ctx.config.defaultBranch;
|
|
1896
|
+
if (typeof branch !== 'string' || branch.trim() === '') {
|
|
1897
|
+
notes.push(`whether GitHub's default branch carries ${WORKFLOW_RUN_PATH} is not graded, because defaultBranch is not a branch name (see the config check)`);
|
|
1898
|
+
}
|
|
1899
|
+
else if (!remoteTrackingBranchResolves(root, branch)) {
|
|
1900
|
+
notes.push(`whether origin/${branch} carries ${WORKFLOW_RUN_PATH} is not graded, because there is no origin/${branch} (see the remote check)`);
|
|
1901
|
+
}
|
|
1902
|
+
else if (!pathAtRef(root, `origin/${branch}`, WORKFLOW_RUN_PATH)) {
|
|
1903
|
+
warnings.push(`origin/${branch} does not carry ${WORKFLOW_RUN_PATH}, as this checkout last fetched it, and GitHub dispatches only a workflow its default branch carries: commit it and push it with \`git push origin ${branch}\``);
|
|
1904
|
+
}
|
|
1905
|
+
}
|
|
1906
|
+
const noted = notes.length > 0 ? `; ${notes.join('; ')}` : '';
|
|
1907
|
+
const on = 'remote execution is on (execution.target github-actions)';
|
|
1908
|
+
if (failures.length > 0)
|
|
1909
|
+
return fail(`${on}: ${[...failures, ...warnings].join('; ')}${noted}`);
|
|
1910
|
+
if (warnings.length > 0)
|
|
1911
|
+
return warn(`${on}: ${warnings.join('; ')}${noted}`);
|
|
1912
|
+
return pass(`${on}: ${WORKFLOW_RUN_PATH} and ${WORKFLOW_RESUME_PATH} are present and ${gh} resolves on PATH${noted}. What this cannot see lives on GitHub — a credential secret (${OAUTH_TOKEN_SECRET} or ${API_KEY_SECRET}), the ${PUSH_URL_SECRET} and ${GIT_TOKEN_SECRET} secrets, and the ${RUNNER_VARIABLE} and ${REMOTE_STOP_VARIABLE} variables; \`${CLI} doctor --check-github\` asks GitHub`);
|
|
1913
|
+
},
|
|
1914
|
+
};
|
|
1915
|
+
/**
|
|
1916
|
+
* What `gh` prints when it cannot reach GitHub at all — `error connecting to api.github.com`, then a
|
|
1917
|
+
* pointer to check the connection. Matched so a network failure grades as *cannot tell* rather than
|
|
1918
|
+
* as the thing asked about being missing.
|
|
1919
|
+
*/
|
|
1920
|
+
const GH_UNREACHABLE_PATTERN = /error connecting to|check your internet connection/i;
|
|
1921
|
+
/**
|
|
1922
|
+
* A stopped call — the bound in `runGh`, or any other signal — and one that could not reach GitHub
|
|
1923
|
+
* are `unknown`; any other non-zero exit is `refused`, quoting `gh`'s own first line.
|
|
1924
|
+
*/
|
|
1925
|
+
function classifyGh(result) {
|
|
1926
|
+
if (result.status === 0)
|
|
1927
|
+
return { kind: 'answered', stdout: result.stdout };
|
|
1928
|
+
const said = firstLine(result.stderr) || firstLine(result.stdout);
|
|
1929
|
+
if (result.status === null)
|
|
1930
|
+
return { kind: 'unknown', why: 'it was stopped before it answered (timed out)' };
|
|
1931
|
+
if (GH_UNREACHABLE_PATTERN.test(result.stderr))
|
|
1932
|
+
return { kind: 'unknown', why: `it could not reach GitHub (${said})` };
|
|
1933
|
+
return { kind: 'refused', why: said === '' ? `it exited ${result.status}` : `it exited ${result.status}: ${said}` };
|
|
1934
|
+
}
|
|
1935
|
+
/** The `name` field of each element of a `gh … list --json` array, or `undefined` when it is not that shape. */
|
|
1936
|
+
function ghJsonEntries(stdout) {
|
|
1937
|
+
let parsed;
|
|
1938
|
+
try {
|
|
1939
|
+
parsed = JSON.parse(stdout);
|
|
1940
|
+
}
|
|
1941
|
+
catch {
|
|
1942
|
+
return undefined;
|
|
1943
|
+
}
|
|
1944
|
+
if (!Array.isArray(parsed))
|
|
1945
|
+
return undefined;
|
|
1946
|
+
const entries = new Map();
|
|
1947
|
+
for (const item of parsed) {
|
|
1948
|
+
if (!isJsonObject(item) || typeof item.name !== 'string')
|
|
1949
|
+
return undefined;
|
|
1950
|
+
entries.set(item.name, typeof item.value === 'string' ? item.value : '');
|
|
1951
|
+
}
|
|
1952
|
+
return entries;
|
|
1953
|
+
}
|
|
1954
|
+
/** The positive-integer `days` of an artifact-retention answer, or `undefined` for any other shape. */
|
|
1955
|
+
function retentionDaysOf(stdout) {
|
|
1956
|
+
let parsed;
|
|
1957
|
+
try {
|
|
1958
|
+
parsed = JSON.parse(stdout);
|
|
1959
|
+
}
|
|
1960
|
+
catch {
|
|
1961
|
+
return undefined;
|
|
1962
|
+
}
|
|
1963
|
+
if (!isJsonObject(parsed))
|
|
1964
|
+
return undefined;
|
|
1965
|
+
const days = parsed.days;
|
|
1966
|
+
return typeof days === 'number' && Number.isInteger(days) && days > 0 ? days : undefined;
|
|
1967
|
+
}
|
|
1968
|
+
/**
|
|
1969
|
+
* What GitHub says about the remote setup — asked only under {@link CheckContext.probeGithub}.
|
|
1970
|
+
*
|
|
1971
|
+
* **Off by default** (the module header's choice 3): a default run passes saying it did not ask, and
|
|
1972
|
+
* spawns nothing. Every call goes through `remote/githubActions.ts` → `runGh` with a fixed argument
|
|
1973
|
+
* vector and is a read. Secret **values** are never read: `gh secret list` returns names only.
|
|
1974
|
+
*
|
|
1975
|
+
* Grades, worst wins and every finding is reported:
|
|
1976
|
+
* - `fail` — `gh` does not spawn or `gh auth status` refuses (nothing further is asked); GitHub does
|
|
1977
|
+
* not know `harness-run.yml`; neither credential secret is set.
|
|
1978
|
+
* - `warn` — `HARNESS_PUSH_URL` absent; `harness-resume.yml` unknown to GitHub; `HARNESS_REMOTE_STOP`
|
|
1979
|
+
* set; artifact retention below {@link ARTIFACT_RETENTION_WARN_DAYS} days; and any call that timed
|
|
1980
|
+
* out, could not reach GitHub, or answered in a shape not understood — *cannot tell* is not
|
|
1981
|
+
* *missing*, so it never fails.
|
|
1982
|
+
* - both credential secrets present is a note, not a finding: billing follows `ANTHROPIC_API_KEY`.
|
|
1983
|
+
* - the retention read refused (typically HTTP 403: the endpoint needs admin access) is a note too —
|
|
1984
|
+
* the read is best-effort, and a collaborator without admin can still run remotely.
|
|
1985
|
+
*
|
|
1986
|
+
* **Why 30 days.** A parked run waits on a human answer and a usage-paused one on a reset, and the
|
|
1987
|
+
* `harness-state` bundle is the only remote copy of either; once the repository's retention expires
|
|
1988
|
+
* it, the run can no longer be answered and loses its carried counts. Thirty days covers an ordinary
|
|
1989
|
+
* absence — a holiday — while GitHub's own default of 90 passes; below it, an ordinary absence can
|
|
1990
|
+
* cost a parked run its question.
|
|
1991
|
+
*/
|
|
1992
|
+
const REMOTE_GITHUB_CHECK = {
|
|
1993
|
+
id: 'remote-github',
|
|
1994
|
+
title: 'what GitHub says about the remote setup',
|
|
1995
|
+
run: (ctx) => {
|
|
1996
|
+
if (ctx.repoRoot === undefined)
|
|
1997
|
+
return unevaluated('the repository root did not resolve (see the git check)');
|
|
1998
|
+
if (ctx.config === undefined)
|
|
1999
|
+
return unevaluated(`${CONFIG_FILENAME} could not be read (see the config check)`);
|
|
2000
|
+
if (!remoteExecutionApplies(ctx.config))
|
|
2001
|
+
return pass('remote execution is off (`execution.target`), so nothing was asked of GitHub');
|
|
2002
|
+
if (!ctx.probeGithub)
|
|
2003
|
+
return pass(`not asked — run \`${CLI} doctor --check-github\` to ask GitHub about the secrets, variables and workflows a remote run needs`);
|
|
2004
|
+
const root = ctx.repoRoot;
|
|
2005
|
+
const gh = ghCli();
|
|
2006
|
+
const ask = (args) => {
|
|
2007
|
+
const result = runGh(args, root);
|
|
2008
|
+
return { call: `\`gh ${args.join(' ')}\``, answer: result === undefined ? undefined : classifyGh(result) };
|
|
2009
|
+
};
|
|
2010
|
+
const ghRemedy = `install the GitHub CLI (https://cli.github.com) and run \`gh auth login\`, or point ${GH_CLI_VARIABLE} at it`;
|
|
2011
|
+
const noSpawn = `${gh} could not be run, so GitHub was not asked: ${ghRemedy}`;
|
|
2012
|
+
const cannotTell = (call, why, what) => `cannot tell ${what}: ${call} gave no answer, because ${why}`;
|
|
2013
|
+
const auth = ask(['auth', 'status']);
|
|
2014
|
+
if (auth.answer === undefined)
|
|
2015
|
+
return fail(noSpawn);
|
|
2016
|
+
if (auth.answer.kind === 'unknown')
|
|
2017
|
+
return warn(cannotTell(auth.call, auth.answer.why, 'whether gh is authenticated, so nothing further was asked'));
|
|
2018
|
+
if (auth.answer.kind === 'refused')
|
|
2019
|
+
return fail(`${auth.call} reports no usable login, because ${auth.answer.why}: run \`gh auth login\``);
|
|
2020
|
+
const failures = [];
|
|
2021
|
+
const warnings = [];
|
|
2022
|
+
const notes = [];
|
|
2023
|
+
const run = ask(['workflow', 'view', WORKFLOW_RUN_FILE]);
|
|
2024
|
+
if (run.answer === undefined)
|
|
2025
|
+
return fail(noSpawn);
|
|
2026
|
+
if (run.answer.kind === 'unknown')
|
|
2027
|
+
warnings.push(cannotTell(run.call, run.answer.why, `whether GitHub knows ${WORKFLOW_RUN_FILE}`));
|
|
2028
|
+
if (run.answer.kind === 'refused') {
|
|
2029
|
+
failures.push(`GitHub does not know ${WORKFLOW_RUN_FILE} (${run.call}: ${run.answer.why}), so no remote run can be dispatched: push ${WORKFLOW_RUN_PATH} to the repository's default branch`);
|
|
2030
|
+
}
|
|
2031
|
+
const secrets = ask(['secret', 'list', '--json', 'name']);
|
|
2032
|
+
if (secrets.answer === undefined)
|
|
2033
|
+
return fail(noSpawn);
|
|
2034
|
+
const secretNames = secrets.answer.kind === 'answered' ? ghJsonEntries(secrets.answer.stdout) : undefined;
|
|
2035
|
+
if (secrets.answer.kind !== 'answered') {
|
|
2036
|
+
warnings.push(cannotTell(secrets.call, secrets.answer.why, 'which repository secrets are set'));
|
|
2037
|
+
}
|
|
2038
|
+
else if (secretNames === undefined) {
|
|
2039
|
+
warnings.push(`cannot tell which repository secrets are set: ${secrets.call} answered in a shape this check does not read`);
|
|
2040
|
+
}
|
|
2041
|
+
else {
|
|
2042
|
+
const oauth = secretNames.has(OAUTH_TOKEN_SECRET);
|
|
2043
|
+
const apiKey = secretNames.has(API_KEY_SECRET);
|
|
2044
|
+
if (!oauth && !apiKey) {
|
|
2045
|
+
failures.push(`neither ${OAUTH_TOKEN_SECRET} nor ${API_KEY_SECRET} is a repository secret, so a remote run cannot authenticate its agent: set one with \`gh secret set <name>\` — billing follows ${API_KEY_SECRET} when both are set`);
|
|
2046
|
+
}
|
|
2047
|
+
else if (oauth && apiKey) {
|
|
2048
|
+
notes.push(`both ${OAUTH_TOKEN_SECRET} and ${API_KEY_SECRET} are set, so billing follows ${API_KEY_SECRET}`);
|
|
2049
|
+
}
|
|
2050
|
+
if (!secretNames.has(PUSH_URL_SECRET)) {
|
|
2051
|
+
warnings.push(`${PUSH_URL_SECRET} is not a repository secret, so notifications from a remote run reach no one: set it with \`gh secret set ${PUSH_URL_SECRET}\``);
|
|
2052
|
+
}
|
|
2053
|
+
}
|
|
2054
|
+
const resume = ask(['workflow', 'view', WORKFLOW_RESUME_FILE]);
|
|
2055
|
+
if (resume.answer === undefined)
|
|
2056
|
+
return fail(noSpawn);
|
|
2057
|
+
if (resume.answer.kind === 'unknown')
|
|
2058
|
+
warnings.push(cannotTell(resume.call, resume.answer.why, `whether GitHub knows ${WORKFLOW_RESUME_FILE}`));
|
|
2059
|
+
if (resume.answer.kind === 'refused') {
|
|
2060
|
+
warnings.push(`GitHub does not know ${WORKFLOW_RESUME_FILE} (${resume.call}: ${resume.answer.why}), so usage auto-resume is unavailable: push ${WORKFLOW_RESUME_PATH} to the repository's default branch`);
|
|
2061
|
+
}
|
|
2062
|
+
const variables = ask(['variable', 'list', '--json', 'name,value']);
|
|
2063
|
+
if (variables.answer === undefined)
|
|
2064
|
+
return fail(noSpawn);
|
|
2065
|
+
const variableValues = variables.answer.kind === 'answered' ? ghJsonEntries(variables.answer.stdout) : undefined;
|
|
2066
|
+
let runner;
|
|
2067
|
+
if (variables.answer.kind !== 'answered') {
|
|
2068
|
+
warnings.push(cannotTell(variables.call, variables.answer.why, `the ${RUNNER_VARIABLE} and ${REMOTE_STOP_VARIABLE} variables`));
|
|
2069
|
+
}
|
|
2070
|
+
else if (variableValues === undefined) {
|
|
2071
|
+
warnings.push(`cannot tell the ${RUNNER_VARIABLE} and ${REMOTE_STOP_VARIABLE} variables: ${variables.call} answered in a shape this check does not read`);
|
|
2072
|
+
}
|
|
2073
|
+
else {
|
|
2074
|
+
const label = variableValues.get(RUNNER_VARIABLE)?.trim() ?? '';
|
|
2075
|
+
runner = label === '' ? 'GitHub-hosted (`ubuntu-latest`)' : `runner label \`${label}\``;
|
|
2076
|
+
if ((variableValues.get(REMOTE_STOP_VARIABLE) ?? '') !== '') {
|
|
2077
|
+
warnings.push(`${REMOTE_STOP_VARIABLE} is set, so every remote start and continuation is stopped: \`gh variable delete ${REMOTE_STOP_VARIABLE}\` lifts it`);
|
|
2078
|
+
}
|
|
2079
|
+
}
|
|
2080
|
+
const retention = ask(['api', ARTIFACT_RETENTION_ENDPOINT]);
|
|
2081
|
+
if (retention.answer === undefined)
|
|
2082
|
+
return fail(noSpawn);
|
|
2083
|
+
let retentionDays;
|
|
2084
|
+
if (retention.answer.kind === 'unknown') {
|
|
2085
|
+
warnings.push(cannotTell(retention.call, retention.answer.why, 'how long the repository keeps artifacts'));
|
|
2086
|
+
}
|
|
2087
|
+
else if (retention.answer.kind === 'refused') {
|
|
2088
|
+
notes.push(`artifact retention not checked: ${retention.call} needs admin access (${retention.answer.why})`);
|
|
2089
|
+
}
|
|
2090
|
+
else {
|
|
2091
|
+
retentionDays = retentionDaysOf(retention.answer.stdout);
|
|
2092
|
+
if (retentionDays === undefined) {
|
|
2093
|
+
warnings.push(`cannot tell how long the repository keeps artifacts: ${retention.call} answered in a shape this check does not read`);
|
|
2094
|
+
}
|
|
2095
|
+
else if (retentionDays < ARTIFACT_RETENTION_WARN_DAYS) {
|
|
2096
|
+
warnings.push(`the repository keeps artifacts for ${retentionDays} days, so a remote run parked or paused longer than that loses its state bundle: raise it under Settings → Actions → General → Artifact and log retention`);
|
|
2097
|
+
}
|
|
2098
|
+
}
|
|
2099
|
+
const noted = notes.length > 0 ? `; ${notes.join('; ')}` : '';
|
|
2100
|
+
if (failures.length > 0)
|
|
2101
|
+
return fail(`${[...failures, ...warnings].join('; ')}${noted}`);
|
|
2102
|
+
if (warnings.length > 0)
|
|
2103
|
+
return warn(`${warnings.join('; ')}${noted}`);
|
|
2104
|
+
const kept = retentionDays === undefined ? '' : `, and the repository keeps artifacts for ${retentionDays} days`;
|
|
2105
|
+
return pass(`gh is authenticated, GitHub knows ${WORKFLOW_RUN_FILE} and ${WORKFLOW_RESUME_FILE}, a credential secret and ${PUSH_URL_SECRET} are set, and remote runs use ${runner}${kept}${noted}`);
|
|
2106
|
+
},
|
|
2107
|
+
};
|
|
1796
2108
|
/**
|
|
1797
2109
|
* The config's shape, re-checked at runtime.
|
|
1798
2110
|
*
|
|
@@ -3044,7 +3356,7 @@ function namesHelperScript(entry) {
|
|
|
3044
3356
|
* With nothing left to grade — the phase off at a single root — it reports **not graded** and names
|
|
3045
3357
|
* which, rather than a pass an adopter would read as coverage.
|
|
3046
3358
|
*
|
|
3047
|
-
* The helper names come from **reading `<root>/scripts/`** ({@link
|
|
3359
|
+
* The helper names come from **reading `<root>/scripts/`** ({@link pluginRootHelpers}) at each
|
|
3048
3360
|
* graded root and taking the union, never from a list kept here: they are declared once, in the
|
|
3049
3361
|
* plugin's own `scripts/README.md`, and a copy in this file would be a second declaration that
|
|
3050
3362
|
* drifts the first time one is added. Nothing here classifies a helper by its call site either —
|
|
@@ -3129,7 +3441,7 @@ const PLUGIN_PERMISSIONS_CHECK = {
|
|
|
3129
3441
|
// complete that is one unreadable file away from a stall.
|
|
3130
3442
|
const phaseKnown = ctx.config !== undefined;
|
|
3131
3443
|
const qaOn = ctx.config?.phases?.qa === true;
|
|
3132
|
-
const helpers =
|
|
3444
|
+
const helpers = pluginRootHelpers(roots, qaOn);
|
|
3133
3445
|
const groups = roots.map((root) => ({
|
|
3134
3446
|
root,
|
|
3135
3447
|
label: split
|
|
@@ -3139,17 +3451,15 @@ const PLUGIN_PERMISSIONS_CHECK = {
|
|
|
3139
3451
|
: installRoot === undefined
|
|
3140
3452
|
? `the directory this marketplace is sourced from (the only root that resolved: ${installedPluginsPath()} records no install root)`
|
|
3141
3453
|
: `the one plugin root this machine resolves, recorded in ${installedPluginsPath()}`,
|
|
3142
|
-
|
|
3143
|
-
|
|
3144
|
-
|
|
3145
|
-
|
|
3146
|
-
|
|
3147
|
-
|
|
3148
|
-
|
|
3149
|
-
|
|
3150
|
-
|
|
3151
|
-
})),
|
|
3152
|
-
],
|
|
3454
|
+
// The builder `init --plugin-root-entries` writes through too, so the two cannot differ. The
|
|
3455
|
+
// read rule is outside the phase gate and absent at the install root: reads there were measured
|
|
3456
|
+
// to succeed ungranted, ten at the runtime root to be refused.
|
|
3457
|
+
required: pluginRootEntries(root, { isInstallRoot: root === installRoot, helpers }).map(({ kind, rule }) => ({
|
|
3458
|
+
rule,
|
|
3459
|
+
symptom: kind === 'read'
|
|
3460
|
+
? 'improvises in place of a contract file it is refused'
|
|
3461
|
+
: 'parks with no error at the first helper script it reaches',
|
|
3462
|
+
})),
|
|
3153
3463
|
}));
|
|
3154
3464
|
const required = groups.flatMap((group) => group.required);
|
|
3155
3465
|
if (required.length === 0) {
|
|
@@ -3583,6 +3893,9 @@ const RETRIEVAL_INDEX_CHECK = {
|
|
|
3583
3893
|
* for the machine around it — and they are meant to be read together. `daemon-path` comes last of
|
|
3584
3894
|
* the six because it is the only one that grades an *installed* unit: it has nothing to say until the
|
|
3585
3895
|
* five above it are answered, and it says so rather than guessing.
|
|
3896
|
+
* `remote-execution` follows it because it asks the same "can this run unattended" question of a run
|
|
3897
|
+
* the watcher dispatches to GitHub rather than spawns here, and `remote-github` follows that because it
|
|
3898
|
+
* asks GitHub the half of the same question local evidence cannot answer.
|
|
3586
3899
|
*
|
|
3587
3900
|
* `plugin-permissions` closes the profile block for the same shape of reason: it is the only profile
|
|
3588
3901
|
* question whose other half is not in the repository at all — the plugin's machine-local install
|
|
@@ -3608,6 +3921,8 @@ export const CHECKS = Object.freeze([
|
|
|
3608
3921
|
REPO_REGISTRY_CHECK,
|
|
3609
3922
|
MACHINE_FOOTPRINT_CHECK,
|
|
3610
3923
|
DAEMON_PATH_CHECK,
|
|
3924
|
+
REMOTE_EXECUTION_CHECK,
|
|
3925
|
+
REMOTE_GITHUB_CHECK,
|
|
3611
3926
|
CONFIG_CHECK,
|
|
3612
3927
|
COMMAND_WRAPPERS_CHECK,
|
|
3613
3928
|
COMMAND_PERMISSIONS_CHECK,
|