@otwld/workflow-cli 0.1.31 → 0.1.32

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.
@@ -1,4 +1,3 @@
1
- import { parse } from 'yaml';
2
1
  /**
3
2
  * Validate an object-shaped external value.
4
3
  * @param value - External value to validate.
@@ -44,76 +43,4 @@ export function classifyAudit(code, value) {
44
43
  return 'technical-error';
45
44
  }
46
45
  }
47
- /**
48
- * Accept repository files needed for remediation without exposing Git metadata.
49
- * @param path - Repository-relative correction path.
50
- * @returns Whether the path remains inside the checkout.
51
- */
52
- export function allowedAuditPath(path) {
53
- return (Boolean(path) &&
54
- !path.startsWith('/') &&
55
- !path.includes('\\') &&
56
- !path
57
- .split('/')
58
- .some((part) => part === '..' || part === '.git' || part === '') &&
59
- !/^[a-z]:/i.test(path));
60
- }
61
- function canonical(value) {
62
- if (Array.isArray(value)) {
63
- return JSON.stringify(value.map((item) => JSON.parse(canonical(item))));
64
- }
65
- if (value && typeof value === 'object') {
66
- return JSON.stringify(Object.fromEntries(Object.entries(value)
67
- .sort(([a], [b]) => a.localeCompare(b))
68
- .map(([key, item]) => [key, JSON.parse(canonical(item))])));
69
- }
70
- return JSON.stringify(value);
71
- }
72
- function assertAuditSettings(before, after) {
73
- const old = record(before || {});
74
- const next = record(after || {});
75
- for (const key of new Set([...Object.keys(old), ...Object.keys(next)])) {
76
- const previous = old[key];
77
- const proposed = next[key];
78
- // Removing an existing exception strengthens the audit; adding one is not a fix.
79
- if (key.startsWith('ignore') && Array.isArray(previous)) {
80
- if (proposed === undefined ||
81
- (Array.isArray(proposed) &&
82
- proposed.every((item) => previous.some((entry) => canonical(entry) === canonical(item))))) {
83
- continue;
84
- }
85
- }
86
- if (canonical(previous) !== canonical(proposed)) {
87
- throw new Error(`Audit settings changed: ${key}`);
88
- }
89
- }
90
- }
91
- /**
92
- * Permit package replacement, new majors and migration scripts while preserving audit settings.
93
- * @param before - Original package manifest.
94
- * @param after - Corrected package manifest.
95
- */
96
- export function assertManifest(before, after) {
97
- const old = record(record(before)['pnpm'] || {});
98
- const next = record(record(after)['pnpm'] || {});
99
- assertAuditSettings(old['auditConfig'], next['auditConfig']);
100
- }
101
- /**
102
- * Allow workspace migrations without adding audit exceptions or weakening its threshold.
103
- * @param before - Original workspace YAML.
104
- * @param after - Corrected workspace YAML.
105
- */
106
- export function assertWorkspace(before, after) {
107
- assertAuditSettings(record(parse(before))['auditConfig'], record(parse(after))['auditConfig']);
108
- }
109
- /**
110
- * Read the package names affected by the audit report.
111
- * @param value - External value to validate.
112
- * @returns The validated operation result.
113
- */
114
- export function auditPackages(value) {
115
- return [
116
- ...new Set(Object.values(record(record(value)['advisories'])).map((item) => String(record(item)['module_name']))),
117
- ];
118
- }
119
46
  //# sourceMappingURL=audit-policy.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"audit-policy.js","sourceRoot":"","sources":["../../../../apps/workflow-cli/src/audit-policy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,MAAM,CAAC;AAG7B;;;;;GAKG;AACH,MAAM,UAAU,MAAM,CAAC,KAAc;IACnC,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QAChE,MAAM,IAAI,KAAK,CAAC,oBAAoB,CAAC,CAAC;IACxC,CAAC;IACD,OAAO,KAAa,CAAC;AACvB,CAAC;AACD;;;;;GAKG;AACH,MAAM,UAAU,aAAa,CAC3B,IAAmB,EACnB,KAAc;IAEd,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;QAC7B,IAAI,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC;YACpB,OAAO,iBAAiB,CAAC;QAC3B,CAAC;QACD,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC;QAChD,MAAM,MAAM,GA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AC,CAAC,CAAC;QAChD,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC;QACrE,MAAM,MAAM,GAAG,CAAC,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC,GAAG,CAChE,CAAC,GAAG,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,CACrB,CAAC;QACF,IACE,CAAC,MAAM,CAAC,KAAK,CACX,CAAC,KAAK,EAAE,EAAE,CACR,OAAO,KAAK,KAAK,QAAQ,IAAI,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,KAAK,IAAI,CAAC,CACrE,EACD,CAAC;YACD,OAAO,iBAAiB,CAAC;QAC3B,CAAC;QACD,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CACzB,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,EACvC,CAAC,CACF,CAAC;QACF,mFAAmF;QACnF,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC;QAClD,IAAI,IAAI,KAAK,CAAC,IAAI,UAAU,KAAK,CAAC,EAAE,CAAC;YACnC,OAAO,OAAO,CAAC;QACjB,CAAC;QACD,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI,GAAG,CAAC,IAAI,KAAK,GAAG,CAAC,IAAI,UAAU,GAAG,CAAC,EAAE,CAAC;YAC7D,OAAO,YAAY,CAAC;QACtB,CAAC;QACD,OAAO,iBAAiB,CAAC;IAC3B,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,iBAAiB,CAAC;IAC3B,CAAC;AACH,CAAC"}
@@ -1,2 +1,2 @@
1
- /** Default instructions for progressive audit remediation with human review. */
2
- export declare const auditPrompt = "Fix the vulnerabilities reported by pnpm audit in this checkout.\nRead AGENTS.md and applicable domain contexts first. Use pnpm only.\nThe full audit report is at the absolute path in AUDIT_REPORT_FILE.\nWork from the smallest sufficient fix toward broader changes: prefer a targeted\npatch or dependency update, then minor upgrades, major upgrades or package\nreplacement when needed. New packages and changes outside existing version\nranges are allowed. Adapt source code, configuration and tests as necessary.\nKeep the change focused on the audit findings and explain each larger migration.\nDo not hide findings by adding audit ignores, raising the audit threshold,\ndisabling CI, removing tests or weakening their assertions. Preserve repository\ncontracts; update dependency patches when the migration requires it.\nRun pnpm install and pnpm audit. Run focused checks useful for the changes.\nThe workflow will run the complete existing CI independently on your candidate;\ndo not spend the mission budget duplicating the entire CI or preparing browsers\nfor it. Do not commit, push, create PRs, access GitHub or modify credentials.\nFinish within the mission budget. Your final response must describe the changes,\ncommands and results, remaining findings and any migration risks. If no complete\nfix is possible, leave useful changes and a precise diagnostic for a developer.\n";
1
+ /** Dependency remediation, collaboration and publication are owned by the agent. */
2
+ export declare const auditPrompt = "You own this repository's dependency-audit PR and developer communication.\nRead AGENTS.md and relevant domain contexts first. Use pnpm only.\nUse gh and Git normally; GitHub access is configured. Never print credentials.\nRead the supplied audit report. A technical audit error is not evidence of a\nvulnerability: investigate it and report a diagnosis rather than invent a fix.\nFind the existing open audit PR (including older automation/pnpm-audit-* branches)\nand read its description, comments, checks and latest commits. Honor the pause\nlabel. Otherwise check out its current branch and preserve human contributions.\nIf there is no existing PR, create automation/pnpm-audit from the current default\nbranch. Configure Git identity from the authenticated GitHub account when needed\nand use gh auth setup-git to authenticate pushes. Never force-push, rewrite history,\nreset away human work, reopen closed PRs, merge or close a PR automatically.\nInstall repository dependencies before working. Progress from the smallest\nsufficient patch/update through minor upgrades, majors or package replacement.\nNew packages and source/configuration/test migrations are allowed when necessary.\nKeep changes focused. Do not hide findings through audit exceptions, higher audit\nthresholds, disabled CI, removed tests or weakened assertions. Preserve contracts.\nLook for related Renovate PRs and link useful ones; their existence does not block\nyour work. Use judgment rather than a title-matching rule.\nRun focused checks useful for your changes, including pnpm audit. The ordinary PR\nCI owns complete validation; do not duplicate the full CI or wait for it to finish.\nCommit and push useful changes even if the correction is incomplete or checks fail.\nCreate a regular non-draft PR, or update the existing one. Its body must retain the\nsupplied audit marker and explain the changes, broader migrations and limitations.\nOn every attempt, publish context and check results as a PR comment including the\nexact execution URL, even if you made no new commit. Read previous feedback before\nretrying. If the audit was already fixed on the PR, report that and preserve it.\nIf there is no useful change and no PR, create or update one open diagnostic issue\nidentified by the audit marker. Include the execution URL and actionable findings.\nIf a useful unpublished change remains near the deadline, prioritize committing,\npushing and opening/updating its PR over further investigation. A timeout does not\nmake the patch invalid. Finish with a response summarizing changes, checks,\nremaining findings and the PR or issue URL. Never merge automatically.\n";
@@ -1,21 +1,36 @@
1
- /** Default instructions for progressive audit remediation with human review. */
2
- export const auditPrompt = `Fix the vulnerabilities reported by pnpm audit in this checkout.
3
- Read AGENTS.md and applicable domain contexts first. Use pnpm only.
4
- The full audit report is at the absolute path in AUDIT_REPORT_FILE.
5
- Work from the smallest sufficient fix toward broader changes: prefer a targeted
6
- patch or dependency update, then minor upgrades, major upgrades or package
7
- replacement when needed. New packages and changes outside existing version
8
- ranges are allowed. Adapt source code, configuration and tests as necessary.
9
- Keep the change focused on the audit findings and explain each larger migration.
10
- Do not hide findings by adding audit ignores, raising the audit threshold,
11
- disabling CI, removing tests or weakening their assertions. Preserve repository
12
- contracts; update dependency patches when the migration requires it.
13
- Run pnpm install and pnpm audit. Run focused checks useful for the changes.
14
- The workflow will run the complete existing CI independently on your candidate;
15
- do not spend the mission budget duplicating the entire CI or preparing browsers
16
- for it. Do not commit, push, create PRs, access GitHub or modify credentials.
17
- Finish within the mission budget. Your final response must describe the changes,
18
- commands and results, remaining findings and any migration risks. If no complete
19
- fix is possible, leave useful changes and a precise diagnostic for a developer.
1
+ /** Dependency remediation, collaboration and publication are owned by the agent. */
2
+ export const auditPrompt = `You own this repository's dependency-audit PR and developer communication.
3
+ Read AGENTS.md and relevant domain contexts first. Use pnpm only.
4
+ Use gh and Git normally; GitHub access is configured. Never print credentials.
5
+ Read the supplied audit report. A technical audit error is not evidence of a
6
+ vulnerability: investigate it and report a diagnosis rather than invent a fix.
7
+ Find the existing open audit PR (including older automation/pnpm-audit-* branches)
8
+ and read its description, comments, checks and latest commits. Honor the pause
9
+ label. Otherwise check out its current branch and preserve human contributions.
10
+ If there is no existing PR, create automation/pnpm-audit from the current default
11
+ branch. Configure Git identity from the authenticated GitHub account when needed
12
+ and use gh auth setup-git to authenticate pushes. Never force-push, rewrite history,
13
+ reset away human work, reopen closed PRs, merge or close a PR automatically.
14
+ Install repository dependencies before working. Progress from the smallest
15
+ sufficient patch/update through minor upgrades, majors or package replacement.
16
+ New packages and source/configuration/test migrations are allowed when necessary.
17
+ Keep changes focused. Do not hide findings through audit exceptions, higher audit
18
+ thresholds, disabled CI, removed tests or weakened assertions. Preserve contracts.
19
+ Look for related Renovate PRs and link useful ones; their existence does not block
20
+ your work. Use judgment rather than a title-matching rule.
21
+ Run focused checks useful for your changes, including pnpm audit. The ordinary PR
22
+ CI owns complete validation; do not duplicate the full CI or wait for it to finish.
23
+ Commit and push useful changes even if the correction is incomplete or checks fail.
24
+ Create a regular non-draft PR, or update the existing one. Its body must retain the
25
+ supplied audit marker and explain the changes, broader migrations and limitations.
26
+ On every attempt, publish context and check results as a PR comment including the
27
+ exact execution URL, even if you made no new commit. Read previous feedback before
28
+ retrying. If the audit was already fixed on the PR, report that and preserve it.
29
+ If there is no useful change and no PR, create or update one open diagnostic issue
30
+ identified by the audit marker. Include the execution URL and actionable findings.
31
+ If a useful unpublished change remains near the deadline, prioritize committing,
32
+ pushing and opening/updating its PR over further investigation. A timeout does not
33
+ make the patch invalid. Finish with a response summarizing changes, checks,
34
+ remaining findings and the PR or issue URL. Never merge automatically.
20
35
  `;
21
36
  //# sourceMappingURL=audit-prompt.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"audit-prompt.js","sourceRoot":"","sources":["../../../../apps/workflow-cli/src/audit-prompt.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,MAAM,CAAC,MAAM,WAAW,GAAG;;;;;;;;;;;;;;;;;;CAkB1B,CAAC"}
1
+ {"version":3,"file":"audit-prompt.js","sourceRoot":"","sources":["../../../../apps/workflow-cli/src/audit-prompt.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,MAAM,CAAC,MAAM,WAAW,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiC1B,CAAC"}
package/src/audit.d.ts CHANGED
@@ -1,51 +1,15 @@
1
1
  /**
2
- * Execute Git with the runner toolchain.
3
- * @param args - Git arguments supplied by workflow-cli.
4
- * @returns The validated operation result.
2
+ * Execute the same unfiltered dependency audit as ordinary CI.
3
+ * @returns The report and whether pnpm found actionable vulnerabilities.
4
+ * @throws If the registry or audit command fails technically.
5
5
  */
6
- export declare function git(...args: string[]): string;
7
- /**
8
- * Write a single-line GitHub Actions output.
9
- * @param name - Required environment variable name.
10
- * @param value - External value to validate.
11
- */
12
- export declare function output(name: string, value: string): void;
13
- /**
14
- * Resolve a required workflow environment input.
15
- * @param env - Workflow environment and operation-specific inputs.
16
- * @param key - Operation input supplied by the calling workflow.
17
- * @returns The validated operation result.
18
- * @throws If the input or external operation fails validation.
19
- */
20
- export declare function required(env: NodeJS.ProcessEnv, key: string): string;
21
- /**
22
- * Execute the same unfiltered pnpm audit as CI.
23
- * @param cwd - Directory containing the consumer pnpm workspace.
24
- * @returns The validated operation result.
25
- * @throws If the input or external operation fails validation.
26
- */
27
- export declare function audit(cwd?: string): {
28
- /**
29
- * The status value used by the workflow contract.
30
- */
6
+ export declare function audit(): {
31
7
  status: 'clean' | 'vulnerable';
32
- /**
33
- * The report value used by the workflow contract.
34
- */
35
8
  report: unknown;
36
9
  };
37
10
  /**
38
- * Validate the dependency correction and serialize its Git patch.
39
- * @param base - Original default-branch commit SHA.
40
- * @returns The validated operation result.
41
- * @throws If the input or external operation fails validation.
42
- */
43
- export declare function verifyAuditPatch(base: string): string;
44
- /**
45
- * Execute one dependency-audit workflow phase.
46
- * @param phase - Audit lifecycle phase to execute.
47
- * @param env - Workflow environment and operation-specific inputs.
48
- * @returns The asynchronous operation result.
49
- * @throws If the input or external operation fails validation.
11
+ * Prepare one prompt-driven mission, or ensure its developer-facing diagnosis.
12
+ * @param phase - Prepare or report.
13
+ * @param env - Workflow environment and optional mission overrides.
50
14
  */
51
15
  export declare function runAuditCommand(phase: string, env: NodeJS.ProcessEnv): Promise<void>;
package/src/audit.js CHANGED
@@ -1,54 +1,17 @@
1
- import { executable } from './executable.js';
2
1
  import { execFileSync, spawnSync } from 'node:child_process';
3
- import { appendFileSync, existsSync, readFileSync, writeFileSync, mkdtempSync, rmSync, } from 'node:fs';
2
+ import { appendFileSync, existsSync, mkdirSync, readFileSync, writeFileSync, } from 'node:fs';
4
3
  import { join, resolve } from 'node:path';
5
- import { tmpdir } from 'node:os';
6
- import { allowedAuditPath, assertManifest, assertWorkspace, auditPackages, classifyAudit, } from './audit-policy.js';
4
+ import { executable } from './executable.js';
5
+ import { classifyAudit } from './audit-policy.js';
7
6
  import { auditPrompt } from './audit-prompt.js';
7
+ import { auditMarker, auditPauseLabel, auditPull, auditRunUrl, ensureAuditDiagnostic, } from './audit-github.js';
8
8
  /**
9
- * Execute Git with the runner toolchain.
10
- * @param args - Git arguments supplied by workflow-cli.
11
- * @returns The validated operation result.
12
- */
13
- export function git(...args) {
14
- return execFileSync(executable('git'), args, {
15
- encoding: 'utf8',
16
- maxBuffer: 32 * 1024 * 1024,
17
- });
18
- }
19
- /**
20
- * Write a single-line GitHub Actions output.
21
- * @param name - Required environment variable name.
22
- * @param value - External value to validate.
23
- */
24
- export function output(name, value) {
25
- if (process.env['GITHUB_OUTPUT']) {
26
- appendFileSync(process.env['GITHUB_OUTPUT'], `${name}=${value}\n`);
27
- }
28
- }
29
- /**
30
- * Resolve a required workflow environment input.
31
- * @param env - Workflow environment and operation-specific inputs.
32
- * @param key - Operation input supplied by the calling workflow.
33
- * @returns The validated operation result.
34
- * @throws If the input or external operation fails validation.
35
- */
36
- export function required(env, key) {
37
- const value = env[key];
38
- if (!value) {
39
- throw new Error(`Missing ${key}`);
40
- }
41
- return value;
42
- }
43
- /**
44
- * Execute the same unfiltered pnpm audit as CI.
45
- * @param cwd - Directory containing the consumer pnpm workspace.
46
- * @returns The validated operation result.
47
- * @throws If the input or external operation fails validation.
9
+ * Execute the same unfiltered dependency audit as ordinary CI.
10
+ * @returns The report and whether pnpm found actionable vulnerabilities.
11
+ * @throws If the registry or audit command fails technically.
48
12
  */
49
- export function audit(cwd = process.cwd()) {
13
+ export function audit() {
50
14
  const result = spawnSync(executable('pnpm'), ['audit', '--json'], {
51
- cwd,
52
15
  encoding: 'utf8',
53
16
  maxBuffer: 32 * 1024 * 1024,
54
17
  });
@@ -61,183 +24,86 @@ export function audit(cwd = process.cwd()) {
61
24
  }
62
25
  const status = classifyAudit(result.status, report);
63
26
  if (status === 'technical-error') {
64
- throw new Error('Audit failed technically; no correction will be proposed');
27
+ throw new Error('Audit failed technically');
65
28
  }
66
29
  return { status, report };
67
30
  }
68
31
  /**
69
- * Validate the dependency correction and serialize its Git patch.
70
- * @param base - Original default-branch commit SHA.
71
- * @returns The validated operation result.
72
- * @throws If the input or external operation fails validation.
73
- */
74
- export function verifyAuditPatch(base) {
75
- git('add', '--intent-to-add', '.');
76
- const files = git('diff', '--name-only', '-z', base)
77
- .split('\0')
78
- .filter(Boolean);
79
- if (!files.length) {
80
- throw new Error('No correction produced');
81
- }
82
- for (const file of files) {
83
- verifyCorrectionFile(base, file);
84
- }
85
- return git('diff', '--binary', base);
86
- }
87
- function verifyCorrectionFile(base, file) {
88
- if (!allowedAuditPath(file)) {
89
- throw new Error(`Disallowed correction: ${file}`);
90
- }
91
- if (/120000|160000/.test(git('diff', '--raw', base, '--', file))) {
92
- throw new Error(`Symlink or submodule: ${file}`);
93
- }
94
- if (file.endsWith('package.json') && existsSync(file)) {
95
- assertManifest(git('ls-tree', '--name-only', base, '--', file).trim()
96
- ? JSON.parse(git('show', `${base}:${file}`))
97
- : {}, JSON.parse(readFileSync(file, 'utf8')));
98
- }
99
- if (file === 'pnpm-workspace.yaml' && existsSync(file)) {
100
- assertWorkspace(git('show', `${base}:${file}`), readFileSync(file, 'utf8'));
101
- }
102
- }
103
- /**
104
- * Execute one dependency-audit workflow phase.
105
- * @param phase - Audit lifecycle phase to execute.
106
- * @param env - Workflow environment and operation-specific inputs.
107
- * @returns The asynchronous operation result.
108
- * @throws If the input or external operation fails validation.
32
+ * Prepare one prompt-driven mission, or ensure its developer-facing diagnosis.
33
+ * @param phase - Prepare or report.
34
+ * @param env - Workflow environment and optional mission overrides.
109
35
  */
110
36
  export async function runAuditCommand(phase, env) {
111
- if (phase === 'validation-result') {
112
- requireValidationResults(env);
113
- return;
37
+ if (!['prepare', 'report'].includes(phase)) {
38
+ throw new Error(`Unsupported audit phase: ${phase}`);
114
39
  }
115
- const directory = resolve(required(env, 'AUDIT_DIRECTORY'));
116
- if (phase === 'inspect') {
117
- const base = git('rev-parse', 'HEAD').trim();
118
- const result = audit();
119
- writeFileSync(join(directory, 'audit.json'), JSON.stringify(result.report, null, 2));
120
- writeFileSync(join(directory, 'base.txt'), base);
121
- output('base-sha', base);
122
- output('status', result.status);
123
- return;
40
+ if (!env.AUDIT_DIRECTORY) {
41
+ throw new Error('Missing AUDIT_DIRECTORY');
124
42
  }
125
- if (phase === 'diagnose') {
126
- collectDiagnosis(directory, env);
43
+ const directory = resolve(env.AUDIT_DIRECTORY);
44
+ mkdirSync(directory, { recursive: true });
45
+ if (phase === 'report') {
46
+ reportMission(directory, env);
127
47
  return;
128
48
  }
129
- if (phase === 'prepare') {
130
- writeFileSync(join(directory, 'prompt.md'), env['AUDIT_PROMPT'] || auditPrompt);
49
+ const pull = auditPull(env);
50
+ if (pull?.labels.some((label) => label.name === auditPauseLabel)) {
51
+ output(env, 'status', 'paused');
131
52
  return;
132
53
  }
133
- if (phase === 'verify') {
134
- collectCandidate(directory, env);
135
- return;
136
- }
137
- if (phase === 'renovate') {
138
- await checkRenovate(directory, env);
139
- return;
140
- }
141
- if (phase === 'publish') {
142
- const { publishAudit } = await import('./audit-github.js');
143
- await publishAudit(directory, env);
144
- return;
145
- }
146
- throw new Error(`Unsupported audit phase: ${phase}`);
147
- }
148
- function requireValidationResults(env) {
149
- const failures = [
150
- 'AUDIT_CHECK_RESULT',
151
- 'QUALITY_CHECK_RESULT',
152
- 'PROJECT_CHECK_RESULT',
153
- ]
154
- .filter((key) => env[key] !== 'success')
155
- .map((key) => key + '=' + (env[key] || 'missing'));
156
- if (failures.length) {
157
- throw new Error('Validation failed: ' + failures.join(', '));
158
- }
159
- }
160
- function collectCandidate(directory, env) {
161
- const base = readFileSync(join(directory, 'base.txt'), 'utf8').trim();
162
- const mission = env['CODEX_STATUS'] || 'execution-error';
163
- const candidate = { mission, audit: 'technical-error', verified: false };
54
+ let status;
164
55
  try {
165
- if (git('rev-parse', 'HEAD').trim() !== base) {
166
- throw new Error('Codex changed the checkout commit');
167
- }
168
- const patch = verifyAuditPatch(base);
169
- // Preserve a useful candidate even when the mission timed out or audit remains red.
170
- writeFileSync(join(directory, 'fix.patch'), patch);
171
56
  const result = audit();
172
- candidate.audit = result.status;
173
- writeFileSync(join(directory, 'after.json'), JSON.stringify(result.report, null, 2));
174
- candidate.verified = mission === 'success' && result.status === 'clean';
175
- appendFileSync(join(directory, 'diagnosis.md'), `\nMission: ${mission}. Full audit: ${result.status}.\n`);
57
+ status = result.status;
58
+ writeFileSync(join(directory, 'audit.json'), JSON.stringify(result.report, null, 2));
176
59
  }
177
60
  catch (error) {
178
- appendFileSync(join(directory, 'diagnosis.md'), `\nCandidate verification failed: ${String(error)}\n`);
179
- throw error;
180
- }
181
- finally {
182
- writeFileSync(join(directory, 'candidate.json'), JSON.stringify(candidate));
183
- }
61
+ status = 'technical-error';
62
+ writeFileSync(join(directory, 'audit.json'), JSON.stringify({ error: String(error) }));
63
+ }
64
+ output(env, 'status', status);
65
+ const context = `\n\nExecution context (applies also to a custom prompt):
66
+ Repository: ${env.GITHUB_REPOSITORY}
67
+ Default branch: ${env.DEFAULT_BRANCH}
68
+ Mission budget: ${env.CODEX_TIMEOUT_MINUTES || 20} minutes
69
+ Initial audit: ${status}
70
+ Audit report: ${join(directory, 'audit.json')}
71
+ Execution URL: ${auditRunUrl(env)}
72
+ Audit marker for PR/diagnostic bodies: ${auditMarker}
73
+ Pause label: ${auditPauseLabel}
74
+ Existing audit PR: ${pull ? '#' + pull.number + ' (' + pull.headRefName + ')' : 'none found'}
75
+ `;
76
+ writeFileSync(join(directory, 'prompt.md'), (env.AUDIT_PROMPT || auditPrompt) + context);
184
77
  }
185
- async function checkRenovate(directory, env) {
186
- const { GitHub } = await import('./audit-github.js');
187
- const github = new GitHub(env);
188
- const report = JSON.parse(readFileSync(join(directory, 'audit.json'), 'utf8'));
189
- const packages = auditPackages(report);
190
- const prs = await github.pulls();
191
- const existing = prs.find((pr) => pr.head.ref === 'automation/pnpm-audit' ||
192
- pr.head.ref.startsWith('automation/pnpm-audit-'));
193
- if (existing) {
194
- writeFileSync(join(directory, 'existing.json'), JSON.stringify({ number: existing.number, url: existing.html_url }));
195
- output('renovate', String(existing.number));
196
- return;
78
+ function output(env, key, value) {
79
+ if (env.GITHUB_OUTPUT) {
80
+ appendFileSync(env.GITHUB_OUTPUT, `${key}=${value}\n`);
197
81
  }
198
- const candidates = prs.filter((pr) => /^renovate(?:\[bot\])?$/i.test(pr.user.login) ||
199
- pr.head.ref.startsWith('renovate/'));
200
- for (const pr of candidates) {
201
- const files = await github.pages(`/pulls/${pr.number}/files`);
202
- if (!files.some((file) => allowedAuditPath(file.filename))) {
203
- continue;
204
- }
205
- const temp = mkdtempSync(join(env['RUNNER_TEMP'] || tmpdir(), 'audit-renovate-'));
206
- try {
207
- github.git('fetch', 'origin', pr.head.sha);
208
- git('worktree', 'add', '--detach', temp, pr.head.sha);
209
- if (audit(temp).status === 'clean') {
210
- writeFileSync(join(directory, 'renovate.json'), JSON.stringify({
211
- number: pr.number,
212
- url: pr.html_url,
213
- sha: pr.head.sha,
214
- }));
215
- output('renovate', String(pr.number));
216
- return;
217
- }
218
- if (packages.some((name) => pr.title.includes(name)) ||
219
- /security|vulnerab/i.test(pr.title)) {
220
- writeFileSync(join(directory, 'overlap.json'), JSON.stringify({ number: pr.number, url: pr.html_url }));
221
- output('renovate', String(pr.number));
222
- return;
223
- }
224
- }
225
- finally {
226
- try {
227
- git('worktree', 'remove', '--force', temp);
228
- }
229
- finally {
230
- rmSync(temp, { recursive: true, force: true });
231
- }
82
+ }
83
+ function reportMission(directory, env) {
84
+ const response = env.CODEX_RESPONSE_FILE;
85
+ const text = response && existsSync(response)
86
+ ? readFileSync(response, 'utf8').trim()
87
+ : '';
88
+ const diagnosis = text ||
89
+ `Codex status: ${env.CODEX_STATUS || 'execution-error'}. Inspect this run's logs and artifacts. No final response was produced.`;
90
+ writeFileSync(join(directory, 'diagnosis.md'), diagnosis);
91
+ if (env.GITHUB_STEP_SUMMARY) {
92
+ appendFileSync(env.GITHUB_STEP_SUMMARY, `${diagnosis}\n`);
93
+ }
94
+ // Preserve unpublished edits after a timeout without adding another publisher.
95
+ try {
96
+ execFileSync(executable('git'), ['add', '--intent-to-add', '.'], {
97
+ stdio: 'pipe',
98
+ });
99
+ const patch = execFileSync(executable('git'), ['diff', '--binary', 'HEAD'], { encoding: 'utf8', maxBuffer: 32 * 1024 * 1024 });
100
+ if (patch) {
101
+ writeFileSync(join(directory, 'unpublished.patch'), patch);
232
102
  }
233
103
  }
234
- }
235
- function collectDiagnosis(directory, env) {
236
- const response = env['CODEX_RESPONSE_FILE'];
237
- const diagnosis = (response &&
238
- existsSync(response) &&
239
- readFileSync(response, 'utf8').trim()) ||
240
- `Codex status: ${env['CODEX_STATUS'] || 'execution-error'}. No final response; inspect the execution logs and preserved candidate.`;
241
- writeFileSync(join(directory, 'diagnosis.md'), diagnosis.slice(0, 12000));
104
+ catch {
105
+ // A failed checkout/setup still needs its GitHub diagnosis.
106
+ }
107
+ ensureAuditDiagnostic(env, diagnosis.slice(0, 12000));
242
108
  }
243
109
  //# sourceMappingURL=audit.js.map
package/src/audit.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"audit.js","sourceRoot":"","sources":["../../../../apps/workflow-cli/src/audit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,EACL,cAAc,EACd,UAAU,EACV,YAAY,EACZ,aAAa,EACb,WAAW,EACX,MAAM,GACP,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,aAAa,EACb,aAAa,GACd,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD;;;;GAIG;AACH,MAAM,UAAU,GAAG,CAAC,GAAG,IAAc;IACnC,OAAO,YAAY,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE;QAC3C,QAAQ,EAAE,MAAM;QAChB,SAAS,EAAE,EAAE,GAAG,IAAI,GAAG,IAAI;KAC5B,CAAC,CAAC;AACL,CAAC;AACD;;;;GAIG;AACH,MAAM,UAAU,MAAM,CAAC,IAAY,EAAE,KAAa;IAChD,IAAI,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,EAAE,CAAC;QACjC,cAAc,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,EAAE,GAAG,IAAI,IAAI,KAAK,IAAI,CAAC,CAAC;IACrE,CAAC;AACH,CAAC;AACD;;;;;;GAMG;AACH,MAAM,UAAU,QAAQ,CAAC,GAAsB,EAAE,GAAW;IAC1D,M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AC;QACH,MAAM,KAAK,GAAG,YAAY,CACxB,UAAU,CAAC,KAAK,CAAC,EACjB,CAAC,MAAM,EAAE,UAAU,EAAE,MAAM,CAAC,EAC5B,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE,GAAG,IAAI,GAAG,IAAI,EAAE,CAClD,CAAC;QACF,IAAI,KAAK,EAAE,CAAC;YACV,aAAa,CAAC,IAAI,CAAC,SAAS,EAAE,mBAAmB,CAAC,EAAE,KAAK,CAAC,CAAC;QAC7D,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;QACP,4DAA4D;IAC9D,CAAC;IACD,qBAAqB,CAAC,GAAG,EAAE,SAAS,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC;AACxD,CAAC"}
package/src/automation.js CHANGED
@@ -1,6 +1,5 @@
1
1
  import { executeCodex } from './codex.js';
2
2
  import { runAuditCommand } from './audit.js';
3
- import { finishAudit } from './audit-github.js';
4
3
  /**
5
4
  * Execute automation operations which do not require Nx release selection.
6
5
  * @param argv - CLI operation and positional arguments.
@@ -31,13 +30,8 @@ export async function runAutomation(argv, env) {
31
30
  }
32
31
  async function auditOperation(argv, env) {
33
32
  if (argv.length !== 2) {
34
- throw new Error('Expected audit inspect, prepare, diagnose, renovate, verify, publish, finish or validation-result');
35
- }
36
- if (argv[1] === 'finish') {
37
- await finishAudit(env);
38
- }
39
- else {
40
- await runAuditCommand(argv[1], env);
33
+ throw new Error('Expected audit prepare or report');
41
34
  }
35
+ await runAuditCommand(argv[1], env);
42
36
  }
43
37
  //# sourceMappingURL=automation.js.map