Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions .github/workflows/verify-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,18 @@ on:
type: choice
options:
- '@agentworkforce/events'
- '@agentworkforce/persona-kit'
- '@agentworkforce/runtime'
- '@agentworkforce/compose'
- '@agentworkforce/cli'
- 'agentworkforce'
- '@agentworkforce/delivery'
- '@agentworkforce/workload-router'
- '@agentworkforce/persona-kit'
- '@agentworkforce/deploy'
- '@agentworkforce/review-kit'
- '@agentworkforce/mcp-workforce'
- '@agentworkforce/daytona-runner'
- '@agentworkforce/local-surface'
- '@agentworkforce/cli'
- 'agentworkforce'
Comment on lines +18 to +29

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win

Missing @agentworkforce/events in the package options.

The PR objective states that all 13 lockstep publish targets should be exposed, but the options list only contains 12 items. @agentworkforce/events is missing. Since events is present as the first target in the publish.yml configuration, this omission will cause the newly added release-workflows.test.mjs test to fail on assert.deepEqual(verified, published).

🐛 Proposed fix
+          - '`@agentworkforce/events`'
           - '`@agentworkforce/persona-kit`'
           - '`@agentworkforce/runtime`'
           - '`@agentworkforce/compose`'
           - '`@agentworkforce/delivery`'
           - '`@agentworkforce/workload-router`'
           - '`@agentworkforce/deploy`'
           - '`@agentworkforce/review-kit`'
           - '`@agentworkforce/mcp-workforce`'
           - '`@agentworkforce/daytona-runner`'
           - '`@agentworkforce/local-surface`'
           - '`@agentworkforce/cli`'
           - 'agentworkforce'
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- '@agentworkforce/persona-kit'
- '@agentworkforce/runtime'
- '@agentworkforce/compose'
- '@agentworkforce/cli'
- 'agentworkforce'
- '@agentworkforce/delivery'
- '@agentworkforce/workload-router'
- '@agentworkforce/persona-kit'
- '@agentworkforce/deploy'
- '@agentworkforce/review-kit'
- '@agentworkforce/mcp-workforce'
- '@agentworkforce/daytona-runner'
- '@agentworkforce/local-surface'
- '@agentworkforce/cli'
- 'agentworkforce'
- '`@agentworkforce/events`'
- '`@agentworkforce/persona-kit`'
- '`@agentworkforce/runtime`'
- '`@agentworkforce/compose`'
- '`@agentworkforce/delivery`'
- '`@agentworkforce/workload-router`'
- '`@agentworkforce/deploy`'
- '`@agentworkforce/review-kit`'
- '`@agentworkforce/mcp-workforce`'
- '`@agentworkforce/daytona-runner`'
- '`@agentworkforce/local-surface`'
- '`@agentworkforce/cli`'
- 'agentworkforce'
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/verify-publish.yml around lines 18 - 29, Update the
package options list in the verify-publish workflow to include
`@agentworkforce/events`, matching the first target in publish.yml and ensuring
all 13 lockstep publish targets are exposed.

version:
description: 'Version to verify (defaults to the "latest" dist-tag)'
required: false
Expand Down Expand Up @@ -104,7 +110,6 @@ jobs:

const mod = await import('./node_modules/@agentworkforce/cli/dist/cli.js');
assert.equal(typeof mod.main, 'function');
assert.equal(typeof mod.CLI_VERSION, 'string');
console.log(`scoped CLI package smoke passed for ${pkg.name}@${pkg.version}`);
EOF

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"dev:cli": "node packages/cli/dist/cli.js",
"typecheck": "pnpm -r typecheck && pnpm run typecheck:examples",
"typecheck:examples": "tsc -p examples/tsconfig.json --noEmit",
"test": "pnpm -r test",
"test": "node --test scripts/release-workflows.test.mjs && pnpm -r test",
"lint": "pnpm -r lint",
"check": "pnpm run lint && pnpm run typecheck && pnpm run test"
}
Expand Down
74 changes: 74 additions & 0 deletions scripts/release-workflows.test.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
import assert from 'node:assert/strict';
import { readFileSync } from 'node:fs';
import test from 'node:test';

const publishWorkflow = readFileSync('.github/workflows/publish.yml', 'utf8');
const verifyWorkflow = readFileSync('.github/workflows/verify-publish.yml', 'utf8');
Comment thread
miyaontherelay marked this conversation as resolved.

function publishTargetDirectories(workflow) {
const match = workflow.match(/echo "packages=([^"]+)"/);
assert.ok(match, 'publish workflow must declare its package targets');

return match[1].trim().split(/\s+/);
}

function publishPackageNames(workflow = publishWorkflow) {
return publishTargetDirectories(workflow).map((directory) => {
const packageJson = JSON.parse(readFileSync(`packages/${directory}/package.json`, 'utf8'));
return packageJson.name;
});
}

function verifyPackageChoices(workflow = verifyWorkflow) {
const lines = workflow.replaceAll('\r\n', '\n').split('\n');
const packageInput = lines.findIndex((line) => line === ' package:');
assert.notEqual(packageInput, -1, 'verify workflow must declare the package input');

const options = lines.findIndex(
(line, index) => index > packageInput && line === ' options:'
);
assert.notEqual(options, -1, 'verify package input must declare choices');
Comment thread
miyaontherelay marked this conversation as resolved.

const choices = [];
for (const line of lines.slice(options + 1)) {
const match = line.match(/^ - '([^']+)'$/);
if (!match) break;
choices.push(match[1]);
}
return choices;
}

test('Verify Publish exposes every lockstep package exactly once', () => {
const published = publishPackageNames();
const verified = verifyPackageChoices();
Comment thread
miyaontherelay marked this conversation as resolved.

assert.equal(new Set(published).size, published.length, 'publish targets must be unique');
assert.equal(new Set(verified).size, verified.length, 'verify choices must be unique');
assert.deepEqual(verified, published);
});

test('release workflow parsing tolerates CRLF and target whitespace', () => {
assert.deepEqual(publishTargetDirectories('echo "packages= events persona-kit "'), [
'events',
'persona-kit',
]);
assert.deepEqual(
verifyPackageChoices(verifyWorkflow.replaceAll('\n', '\r\n')),
verifyPackageChoices()
);
});

test('scoped CLI verification checks only the supported thin-entry contract', () => {
const match = verifyWorkflow.match(
/- name: Scoped CLI package smoke test([\s\S]*?)\n - name: Library smoke test/
);
assert.ok(match, 'scoped CLI smoke step must exist');

const step = match[1];
assert.match(step, /assert\.equal\(pkg\.name, '@agentworkforce\/cli'\)/);
assert.match(step, /assert\.equal\(pkg\.version, '\$\{\{ steps\.resolve\.outputs\.version \}\}'\)/);
assert.match(step, /assert\.equal\(pkg\.bin, undefined\)/);
assert.match(step, /@agentworkforce\/cli\/dist\/cli\.js/);
assert.match(step, /assert\.equal\(typeof mod\.main, 'function'\)/);
assert.doesNotMatch(step, /CLI_VERSION|cli-impl/);
});
Loading