@@ -57,7 +57,7 @@ describe("minimal npm extended-stable workflow", () => {
5757 const gitFetchLines = source
5858 . split ( "\n" )
5959 . filter ( ( line ) => / \b g i t (?: - C " [ ^ " ] + " ) ? f e t c h \b / u. test ( line ) ) ;
60- expect ( gitFetchLines ) . toHaveLength ( 9 ) ;
60+ expect ( gitFetchLines ) . toHaveLength ( 8 ) ;
6161 expect (
6262 gitFetchLines . every ( ( line ) => line . includes ( "timeout --signal=TERM --kill-after=10s 120s" ) ) ,
6363 ) . toBe ( true ) ;
@@ -119,6 +119,10 @@ describe("minimal npm extended-stable workflow", () => {
119119 parsed . jobs ?. preflight_openclaw_npm ,
120120 "Checkout trusted Plugin SDK API tooling" ,
121121 ) ;
122+ const publishProvenanceRun = publishProvenance . run ;
123+ if ( ! publishProvenanceRun ) {
124+ throw new Error ( "Verify prepared tarball provenance is missing its run script" ) ;
125+ }
122126
123127 expect ( input ) . toEqual ( {
124128 default : "" ,
@@ -141,18 +145,29 @@ describe("minimal npm extended-stable workflow", () => {
141145 expect ( preflightDiff . run ) . toContain ( 'git -C "$tooling_dir" status --porcelain' ) ;
142146 expect ( preflightDiff . run ) . not . toContain ( 'pkg.scripts?.["plugin-sdk:api:diff"]' ) ;
143147 expect ( preflightDiff . run ) . toContain ( 'pnpm --dir "$tooling_dir" run plugin-sdk:api:diff' ) ;
144- expect ( publishProvenance . run ) . toContain ( "plugin-sdk-api-release-evidence.mjs" ) ;
145- expect ( publishProvenance . run ) . toContain ( '--acknowledge "$PLUGIN_SDK_API_ACKNOWLEDGEMENT"' ) ;
146- expect ( publishProvenance . run ) . toContain ( 'npm view "openclaw@${RELEASE_NPM_DIST_TAG}" version' ) ;
147- expect ( publishProvenance . run ) . toContain ( '--current-selector-ref "$current_selector_ref"' ) ;
148- expect ( publishProvenance . run ) . toContain ( '--current-selector-sha "$current_selector_sha"' ) ;
149- expect ( publishProvenance . run ) . toContain ( '--workflow-sha "$PREFLIGHT_WORKFLOW_SHA"' ) ;
148+ expect ( publishProvenanceRun ) . toContain ( "plugin-sdk-api-release-evidence.mjs" ) ;
149+ expect ( publishProvenanceRun ) . toContain ( '--acknowledge "$PLUGIN_SDK_API_ACKNOWLEDGEMENT"' ) ;
150+ expect ( publishProvenanceRun ) . toContain ( 'npm view "openclaw@${RELEASE_NPM_DIST_TAG}" version' ) ;
151+ expect ( publishProvenanceRun ) . toContain (
152+ 'git -C trusted-workflow rev-parse --verify "refs/tags/${current_selector_ref}^{commit}"' ,
153+ ) ;
154+ expect ( publishProvenanceRun ) . not . toContain ( "git fetch" ) ;
155+ expect ( publishProvenanceRun ) . toContain ( '--current-selector-ref "$current_selector_ref"' ) ;
156+ expect ( publishProvenanceRun ) . toContain ( '--current-selector-sha "$current_selector_sha"' ) ;
157+ expect ( publishProvenanceRun ) . toContain ( '--workflow-sha "$PREFLIGHT_WORKFLOW_SHA"' ) ;
150158 expect ( downloadPreflight . run ) . toContain (
151159 '"plugin-sdk-api-release-diff-${PREFLIGHT_RUN_ID}-${PREFLIGHT_RUN_ATTEMPT}"' ,
152160 ) ;
153- expect ( publishProvenance . run ) . toContain (
161+ expect ( publishProvenanceRun ) . toContain (
154162 "Prepared Plugin SDK API evidence does not match its immutable artifact" ,
155163 ) ;
164+ expect (
165+ publishProvenanceRun . indexOf (
166+ "Prepared Plugin SDK API evidence does not match its immutable artifact" ,
167+ ) ,
168+ ) . toBeLessThan (
169+ publishProvenanceRun . indexOf ( 'npm view "openclaw@${RELEASE_NPM_DIST_TAG}" version' ) ,
170+ ) ;
156171 expect ( verifyPreflightRun . run ) . toContain (
157172 '"$preflight_head_branch" == "$EXPECTED_EXTENDED_STABLE_BRANCH"' ,
158173 ) ;
0 commit comments